import { defHttp } from '/@/utils/http/axios'

enum Api {
  TASK_INFO = '/task/getTaskInfo',
  CREATE_TASK = '/task/createTaskInfo',
  GENERATE_CATEGORY = '/task/generate_category',
  GENERATE_ORDER_ASIN = '/task/generate_order_asin',
  GENERATE_ORDER_PRODUCT = '/task/generate_order_product',
  GENERATE_SJ_NAME = '/task/generate_sj_name',
  GENERATE_SJ_PYTHON = '/task/generate_python_sj',
  GENERATE_ORDER_NUM = '/task/generate_order_num',
  GENERATE_LOW_ORDER = '/task/generate_low_order',
  SYNC_ASIN_TO_SYSTEM = '/task/sync_asin_to_system',
  CHECK_ASIN_IS_LIMIT = '/task/check_asin_is_limit',
  SET_ASIN_LIMIT = '/task/set_asin_limit',
  SET_GROUP_LIMIT = '/task/set_group_limit',
  GET_ALL_LIMIT_TYPE = '/task/get_all_limit_type',
}

// Get personal center-basic settings
export const taskInfoApi = (params) => defHttp.post<any>({ url: Api.TASK_INFO, params: params })

export const createTaskInfo = (params) =>
  defHttp.post<any>({ url: Api.CREATE_TASK, params: params })

export const generate_category = (params) =>
  defHttp.post<any>({ url: Api.GENERATE_CATEGORY, params: params })

export const generate_order_asin = (params) =>
  defHttp.post<any>({ url: Api.GENERATE_ORDER_ASIN, params: params })

export const generate_order_product = (params) =>
  defHttp.post<any>({ url: Api.GENERATE_ORDER_PRODUCT, params: params })

export const generate_sj_name = (params) =>
  defHttp.post<any>({ url: Api.GENERATE_SJ_NAME, params: params })

export const generate_sj_python = (params) =>
  defHttp.post<any>({ url: Api.GENERATE_SJ_PYTHON, params: params })

export const generate_order_num = (params) =>
  defHttp.post<any>({ url: Api.GENERATE_ORDER_NUM, params: params })

export const generate_low_order = (params) =>
  defHttp.post<any>({ url: Api.GENERATE_LOW_ORDER, params: params })

export const sync_asin_to_system = (params) =>
  defHttp.post<any>({ url: Api.SYNC_ASIN_TO_SYSTEM, params: params })

export const check_asin_is_limit = (params) =>
  defHttp.post<any>({ url: Api.CHECK_ASIN_IS_LIMIT, params: params })

export const set_asin_limit = (params) =>
  defHttp.post<any>({ url: Api.SET_ASIN_LIMIT, params: params },{ successMessageMode: 'message' })

export const set_group_limit = (params) =>
  defHttp.post<any>({ url: Api.SET_GROUP_LIMIT, params: params },{ successMessageMode: 'message' })

export const getAllLimitType = (params) =>
  defHttp.post<any>({ url: Api.GET_ALL_LIMIT_TYPE, params: params })
